﻿// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
//
// 本项目主要遵循 MIT 许可证和 Apache 许可证（版本 2.0）进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动！任何基于本项目二次开发而产生的一切法律纠纷和责任，我们不承担任何责任！

using Admin.NET.Core;
using System.ComponentModel.DataAnnotations;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;

namespace Admin.NET.Application;

/// <summary>
/// 计划反馈基础输入参数
/// </summary>
public class PlanListBaseInput
{
    /// <summary>
    /// 主键Id
    /// </summary>
    public virtual long? Id { get; set; }
    
    /// <summary>
    /// 船号
    /// </summary>
    [Required(ErrorMessage = "船号不能为空")]
    public virtual string Ch { get; set; }
    
    /// <summary>
    /// 分段
    /// </summary>
    [Required(ErrorMessage = "分段不能为空")]
    public virtual string Fd { get; set; }
    
    /// <summary>
    /// 分类
    /// </summary>
    [Required(ErrorMessage = "分类不能为空")]
    public virtual long? ClassName { get; set; }
    
    /// <summary>
    /// 区域
    /// </summary>
    [Required(ErrorMessage = "区域不能为空")]
    public virtual long? WorkAreaId { get; set; }
    
    /// <summary>
    /// 劳务队
    /// </summary>
    public virtual string? Team { get; set; }
    
    /// <summary>
    /// 计划开工
    /// </summary>
    [Required(ErrorMessage = "计划开工不能为空")]
    public virtual DateTime? PlanStart { get; set; }
    
    /// <summary>
    /// 计划完工
    /// </summary>
    [Required(ErrorMessage = "计划完工不能为空")]
    public virtual DateTime? PlanEnd { get; set; }
    
    /// <summary>
    /// 实际开工
    /// </summary>
    public virtual DateTime? ActualStart { get; set; }
    
    /// <summary>
    /// 实际完工
    /// </summary>
    public virtual DateTime? ActualEnd { get; set; }
    
    /// <summary>
    /// 备注
    /// </summary>
    public virtual string? Remark { get; set; }
    
    /// <summary>
    /// 状态
    /// </summary>
    [Dict(nameof(FinishStatusEnum), AllowNullValue=true)]
    public virtual FinishStatusEnum? Status { get; set; }
    
}

/// <summary>
/// 计划反馈分页查询输入参数
/// </summary>
public class PagePlanListInput : BasePageInput
{
    /// <summary>
    /// 船号
    /// </summary>
    public string Ch { get; set; }
    
    /// <summary>
    /// 分段
    /// </summary>
    public string Fd { get; set; }
    
    /// <summary>
    /// 分类
    /// </summary>
    public long? ClassName { get; set; }
    
    /// <summary>
    /// 区域
    /// </summary>
    public long? WorkAreaId { get; set; }
    
    /// <summary>
    /// 劳务队
    /// </summary>
    public string? Team { get; set; }
    
    /// <summary>
    /// 计划开工范围
    /// </summary>
     public DateTime?[] PlanStartRange { get; set; }
    
    /// <summary>
    /// 计划完工范围
    /// </summary>
     public DateTime?[] PlanEndRange { get; set; }
    
    /// <summary>
    /// 实际开工范围
    /// </summary>
     public DateTime?[] ActualStartRange { get; set; }
    
    /// <summary>
    /// 实际完工范围
    /// </summary>
     public DateTime?[] ActualEndRange { get; set; }
    
    /// <summary>
    /// 备注
    /// </summary>
    public string? Remark { get; set; }
    
    /// <summary>
    /// 状态
    /// </summary>
    [Dict(nameof(FinishStatusEnum), AllowNullValue=true)]
    public FinishStatusEnum? Status { get; set; }
    
    /// <summary>
    /// 开工延期原因
    /// </summary>
    public string? StartDelayReason { get; set; }
    
    /// <summary>
    /// 完工延期原因
    /// </summary>
    public string? EndDelayReason { get; set; }
    
    /// <summary>
    /// 选中主键列表
    /// </summary>
     public List<long> SelectKeyList { get; set; }
}

/// <summary>
/// 计划反馈增加输入参数
/// </summary>
public class AddPlanListInput
{
    /// <summary>
    /// 船号
    /// </summary>
    [Required(ErrorMessage = "船号不能为空")]
    [MaxLength(30, ErrorMessage = "船号字符长度不能超过30")]
    public string Ch { get; set; }
    
    /// <summary>
    /// 分段
    /// </summary>
    [Required(ErrorMessage = "分段不能为空")]
    [MaxLength(30, ErrorMessage = "分段字符长度不能超过30")]
    public string Fd { get; set; }
    
    /// <summary>
    /// 分类
    /// </summary>
    [Required(ErrorMessage = "分类不能为空")]
    public long? ClassName { get; set; }
    
    /// <summary>
    /// 区域
    /// </summary>
    [Required(ErrorMessage = "区域不能为空")]
    public long? WorkAreaId { get; set; }
    
    /// <summary>
    /// 劳务队
    /// </summary>
    [MaxLength(32, ErrorMessage = "劳务队字符长度不能超过32")]
    public string? Team { get; set; }
    
    /// <summary>
    /// 计划开工
    /// </summary>
    [Required(ErrorMessage = "计划开工不能为空")]
    public DateTime? PlanStart { get; set; }
    
    /// <summary>
    /// 计划完工
    /// </summary>
    [Required(ErrorMessage = "计划完工不能为空")]
    public DateTime? PlanEnd { get; set; }
    
    /// <summary>
    /// 实际开工
    /// </summary>
    public DateTime? ActualStart { get; set; }
    
    /// <summary>
    /// 实际完工
    /// </summary>
    public DateTime? ActualEnd { get; set; }
    
    /// <summary>
    /// 备注
    /// </summary>
    [MaxLength(128, ErrorMessage = "备注字符长度不能超过128")]
    public string? Remark { get; set; }
    
    /// <summary>
    /// 状态
    /// </summary>
    [Dict(nameof(FinishStatusEnum), AllowNullValue=true)]
    public FinishStatusEnum? Status { get; set; }
    
}

/// <summary>
/// 计划反馈删除输入参数
/// </summary>
public class DeletePlanListInput
{
    /// <summary>
    /// 主键Id
    /// </summary>
    [Required(ErrorMessage = "主键Id不能为空")]
    public long? Id { get; set; }
    
}

/// <summary>
/// 计划反馈更新输入参数
/// </summary>
public class UpdatePlanListInput
{
    /// <summary>
    /// 主键Id
    /// </summary>    
    [Required(ErrorMessage = "主键Id不能为空")]
    public long? Id { get; set; }
    
    /// <summary>
    /// 船号
    /// </summary>    
    [Required(ErrorMessage = "船号不能为空")]
    [MaxLength(30, ErrorMessage = "船号字符长度不能超过30")]
    public string Ch { get; set; }
    
    /// <summary>
    /// 分段
    /// </summary>    
    [Required(ErrorMessage = "分段不能为空")]
    [MaxLength(30, ErrorMessage = "分段字符长度不能超过30")]
    public string Fd { get; set; }
    
    /// <summary>
    /// 分类
    /// </summary>    
    [Required(ErrorMessage = "分类不能为空")]
    public long? ClassName { get; set; }
    
    /// <summary>
    /// 区域
    /// </summary>    
    [Required(ErrorMessage = "区域不能为空")]
    public long? WorkAreaId { get; set; }
    
    /// <summary>
    /// 劳务队
    /// </summary>    
    [MaxLength(32, ErrorMessage = "劳务队字符长度不能超过32")]
    public string? Team { get; set; }
    
    /// <summary>
    /// 计划开工
    /// </summary>    
    [Required(ErrorMessage = "计划开工不能为空")]
    public DateTime? PlanStart { get; set; }
    
    /// <summary>
    /// 计划完工
    /// </summary>    
    [Required(ErrorMessage = "计划完工不能为空")]
    public DateTime? PlanEnd { get; set; }
    
    /// <summary>
    /// 实际开工
    /// </summary>    
    public DateTime? ActualStart { get; set; }
    
    /// <summary>
    /// 实际完工
    /// </summary>    
    public DateTime? ActualEnd { get; set; }
    
    /// <summary>
    /// 备注
    /// </summary>    
    [MaxLength(128, ErrorMessage = "备注字符长度不能超过128")]
    public string? Remark { get; set; }
    
    /// <summary>
    /// 状态
    /// </summary>    
    [Dict(nameof(FinishStatusEnum), AllowNullValue=true)]
    public FinishStatusEnum? Status { get; set; }
    
}

/// <summary>
/// 计划反馈主键查询输入参数
/// </summary>
public class QueryByIdPlanListInput : DeletePlanListInput
{
}

/// <summary>
/// 下拉数据输入参数
/// </summary>
public class DropdownDataPlanListInput
{
    /// <summary>
    /// 是否用于分页查询
    /// </summary>
    public bool FromPage { get; set; }
}

/// <summary>
/// 计划反馈数据导入实体
/// </summary>
[ExcelImporter(SheetIndex = 1, IsOnlyErrorRows = true)]
public class ImportPlanListInput : BaseImportInput
{
    /// <summary>
    /// 船号
    /// </summary>
    [ImporterHeader(Name = "*船号")]
    [ExporterHeader("*船号", Format = "", Width = 25, IsBold = true)]
    public string Ch { get; set; }
    
    /// <summary>
    /// 分段
    /// </summary>
    [ImporterHeader(Name = "*分段")]
    [ExporterHeader("*分段", Format = "", Width = 25, IsBold = true)]
    public string Fd { get; set; }
    
    /// <summary>
    /// 分类 关联值
    /// </summary>
    [ImporterHeader(IsIgnore = true)]
    [ExporterHeader(IsIgnore = true)]
    public long? ClassName { get; set; }
    
    /// <summary>
    /// 分类 文本
    /// </summary>
    [ImporterHeader(Name = "*分类")]
    [ExporterHeader("*分类", Format = "", Width = 25, IsBold = true)]
    public string ClassNameFkDisplayName { get; set; }
    
    /// <summary>
    /// 区域 关联值
    /// </summary>
    [ImporterHeader(IsIgnore = true)]
    [ExporterHeader(IsIgnore = true)]
    public long? WorkAreaId { get; set; }
    
    /// <summary>
    /// 区域 文本
    /// </summary>
    [ImporterHeader(Name = "*区域")]
    [ExporterHeader("*区域", Format = "", Width = 25, IsBold = true)]
    public string WorkAreaFkDisplayName { get; set; }
    
    /// <summary>
    /// 劳务队
    /// </summary>
    [ImporterHeader(Name = "劳务队")]
    [ExporterHeader("劳务队", Format = "", Width = 25, IsBold = true)]
    public string? Team { get; set; }
    
    /// <summary>
    /// 计划开工
    /// </summary>
    [ImporterHeader(Name = "*计划开工")]
    [ExporterHeader("*计划开工", Format = "yyyy-MM-dd", Width = 25, IsBold = true)]
    public DateTime? PlanStart { get; set; }
    
    /// <summary>
    /// 计划完工
    /// </summary>
    [ImporterHeader(Name = "*计划完工")]
    [ExporterHeader("*计划完工", Format = "yyyy-MM-dd", Width = 25, IsBold = true)]
    public DateTime? PlanEnd { get; set; }
    
    /// <summary>
    /// 实际开工
    /// </summary>
    [ImporterHeader(Name = "实际开工")]
    [ExporterHeader("实际开工", Format = "yyyy-MM-dd", Width = 25, IsBold = true)]
    public DateTime? ActualStart { get; set; }
    
    /// <summary>
    /// 实际完工
    /// </summary>
    [ImporterHeader(Name = "实际完工")]
    [ExporterHeader("实际完工", Format = "yyyy-MM-dd", Width = 25, IsBold = true)]
    public DateTime? ActualEnd { get; set; }
    
    /// <summary>
    /// 备注
    /// </summary>
    [ImporterHeader(Name = "备注")]
    [ExporterHeader("备注", Format = "", Width = 25, IsBold = true)]
    public string? Remark { get; set; }
    
    /// <summary>
    /// 状态
    /// </summary>
    [ImporterHeader(Name = "状态")]
    [ExporterHeader("状态", Format = "", Width = 25, IsBold = true)]
    public FinishStatusEnum? Status { get; set; }
    
    /// <summary>
    /// 开工延期原因
    /// </summary>
    [ImporterHeader(Name = "开工延期原因")]
    [ExporterHeader("开工延期原因", Format = "", Width = 25, IsBold = true)]
    public string? StartDelayReason { get; set; }
    
    /// <summary>
    /// 完工延期原因
    /// </summary>
    [ImporterHeader(Name = "完工延期原因")]
    [ExporterHeader("完工延期原因", Format = "", Width = 25, IsBold = true)]
    public string? EndDelayReason { get; set; }
    
}

/// <summary>
/// 更新延期原因输入参数
/// </summary>
public class UpdateDelayReasonInput
{
    /// <summary>
    /// 主键Id
    /// </summary>
    [Required(ErrorMessage = "主键Id不能为空")]
    public long Id { get; set; }
    
    /// <summary>
    /// 字段名 (StartDelayReason 或 EndDelayReason)
    /// </summary>
    [Required(ErrorMessage = "字段名不能为空")]
    [MaxLength(50, ErrorMessage = "字段名长度不能超过50个字符")]
    public string Field { get; set; }
    
    /// <summary>
    /// 延期原因
    /// </summary>
    [MaxLength(500, ErrorMessage = "延期原因长度不能超过500个字符")]
    public string? Reason { get; set; }
}
